package com.sci99.script;

import java.util.List;

import javax.script.ScriptEngineFactory;
import javax.script.ScriptEngineManager;

public class JsListEngine {
	public static void main(String[] args) {
		ScriptEngineManager mgr = new ScriptEngineManager();
		List<ScriptEngineFactory> factories = mgr.getEngineFactories();
		for (ScriptEngineFactory factory : factories) {
			System.out.println("ScriptEngineFactory Info");

			String engName = factory.getEngineName(); // 引擎名稱
			String engVersion = factory.getEngineVersion(); // 引擎版本
			String langName = factory.getLanguageName(); // Script 語言
			String langVersion = factory.getLanguageVersion(); // 語言版本

			System.out.printf("\tScript Engine: %s (%s)\n", engName, engVersion);
			List<String> engNames = factory.getNames();
			for (String name : engNames) {
				System.out.printf("\tEngine Alias: %s\n", name);
			}

			System.out.printf("\tLanguage: %s (%s)\n", langName, langVersion);
		}
	}
}
